package com.hxci.zhongjiahao.controller;

import com.hxci.zhongjiahao.servcie.UserServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller("zhongjiahaoUserController")
@RequestMapping("user")
public class UserController {

    @RequestMapping("login")
    public String login(){
        return "zhongjiahao/zjhlogin";
    }

    @Autowired
    private UserServcie userServcie;
    @ResponseBody
    @RequestMapping("tologin")
    public Integer tologin( @RequestParam("name") String name, @RequestParam("pass")String  pass){
        System.out.println( name);
        System.out.println( pass);
        Integer res = userServcie.logion(name,pass);
        return res;
    }
}